package com.loop.bigNum;

import java.math.BigInteger;

/**
 * 当数值大于long类型的上限时可以使用 的大数类型
 */
public class BigIntegerDemo {
    public static void main(String[] args) {
        BigInteger bigInteger1 = new BigInteger("314148494687987989849849897");
        BigInteger bigInteger2 = new BigInteger("7");
        BigInteger bigInteger3 = new BigInteger("7");
        System.out.println(bigInteger1.add(bigInteger2));
        System.out.println(bigInteger2.subtract(bigInteger3));
        System.out.println(bigInteger2.divide(bigInteger3));
        System.out.println(bigInteger2.multiply(bigInteger3));
        System.out.println(bigInteger2.negate());
    }
}
